﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Drawing;
using Microsoft.Win32;
using System.Windows;

namespace 控制台应用
{
    public class PictureHelper
    {
        #region 读取图片文件
        /// <summary>
        /// 读取图片文件
        /// </summary>
        /// <returns>字节数组</returns>
        public byte[] readFile(string filePath)
        {
            FileStream fileStream = new FileStream(filePath, FileMode.Open);
            byte[] fileArray = new byte[fileStream.Length];
            fileStream.Read(fileArray, 0, fileArray.Length);
            return fileArray;
        }
        #endregion

        #region 图片转TXT文件
        public string Image2Txt(string imagePath)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.ShowDialog();
            Window window = new Window();
            window.Width = 1280;
            window.Height = 720;

            byte[] fileArray = readFile(imagePath);
            string fileName_Txt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            
            for (int i = 0; i < fileArray.Length; i++)
            {

            }
            return "";

        }
        #endregion
    }
}
